Ans: In short, a class is the definition of an object, and an object is an instance of a class. We can look at the class as a template of the object: it describes all the properties, methods, states, and behaviors that the implementing object will have. As mentioned, an object is an instance of a class, and a class does not become an object until it is instantiated. There can be more instances of objects based on the one class, each with different properties.
Ans: Both loops are used when a unit of code needs to execute repeatedly. The difference is that the for loop is used when you know how many times you need to iterate through the code. On the other hand, the while loop will be used when you need to repeat something until a given statement is true.
The syntax of the while loop in C# is:
while (condition [is true]) { // statements }
The syntax of the while loop in VB.NET is:
While condition [is True] ' statements End While
The syntax of the for loop in C# is:
for (initializer; condition; iterator) { // statements }
The syntax of the for loop in VB.NET is:
For counter [ As datatype ] = start To end [ Step step ] ' statements Next [ counter ]
Learn VB.net by Tekslate - Fastest growing sector in the industry. Explore Online" VB.net Training "and course is aligned with industry needs & developed by industry veterans. Tekslate will turn you into VB.net Expert.
Ans: Boxing is the process of converting a value type to the type object, and unboxing is extracting the value type from the object. While the boxing is implicit, unboxing is explicit.
Ans: LINQ is an acronym for Language Integrated Query, and was introduced with Visual Studio 2008. LINQ is a set of features that extends query capabilities to the .NET language syntax by adding sets of new standard query operators that allow data manipulation, regardless of the data source. Supported data sources are: .NET Framework collections, SQL Server databases, ADO.NET Datasets, XML documents, and any collection of objects that support IEnumerable or the generic IEnumerable<T>interface, in both C# and Visual Basic. In short, LINQ bridges the gap between the world of objects and the world of data.
Ans: IL, or Intermediate Language, is a CPU independent partially compiled code. IL code will be compiled to native machine code using current environmental properties by the Just-In-Time compiler (JIT). JIT compiler translates the IL code to assembly code and uses the CPU architecture of the target machine to execute a .NET application. In .NET, IL is called Common Intermediate Language (CIL), and in the early .NET days, it was called Microsoft Intermediate Language (MSIL).
CLI, or Common Language Infrastructure, is an open specification developed by Microsoft. It is a compiled code library used for deployment, versioning, and security. In .NET there are two CLI types: process assemblies (EXE) and library assemblies (DLL). CLI assemblies contain code in CIL, and as mentioned, during the compilation of CLI programming languages, the source code is translated into CIL code rather than into platform or processor-specific object code.
To summarize:
Ans: Inheritance is one of the most important concepts in object-oriented programming, together with encapsulation and polymorphism. Inheritance allows developers to create new classes that reuse, extend, and modify the behavior defined in other classes. This enables code reuse and speeds up development. With inheritance, developers can write and debug one class only once, and then reuse that same code as the basis for the new classes. The class whose members are inherited is called the base class, and the class that inherits those members is called the derived class. By default, all classes in .NET are inheritable.
Ans: In LINQ, deferred execution simply means that the query is not executed at the time it is specified. Specifically, this is accomplished by assigning the query to a variable. When this is done, the query definition is stored in the variable but the query is not executed until the query variable is iterated over.
For example:
DataContext product context = new DataContext(); var product query = from product in product context.Products where product.Type == "SOAPS" select product; // Query is NOT executed here for each (var product in product query) // Query executes HERE { Console.WriteLine(product.Name); }
You can also force immediate execution of a query. This can be useful, for example, if the database is being updated frequently, and it is important in the logic of your program to ensure that the results you’re accessing are those returned at the point in your code where the query was specified. Immediate execution is often forced using a method such as Average, Sum, Count, List, ToList, or ToArray. For example:
DataContext product context = new DataContext(); var productCountQuery = (from product in productContext.Products where product.Type == "SOAPS" select product).Count(); // Query executes HERE
Ans: It is always public.
You would know that System.Object is the parent class of all .NET classes; In other words, all types in .NET (whether implicit, explicit, or user-created) derive from the System.Object class.
Ans: System.Object provides the following important methods, among others:
Most of these methods provide the basic implementation required of any type that a developer will work within the .NET stack.
Ans: Vb.net is a programming language that is available in Visual Studio. Net. It contains features of visual basic which is an event-based programming language and also includes object-oriented concepts. [VB.Net is a programming language that is an extension of Visual Basic to make it compliant with the Dot Net Framework. Also, VB.Net is fully Object Oriented unlike Visual Basic and everything in VB.Net is an object. As it is compliant with the Dot Net Framework VB.Net can make full use of Framework Class Library provided by dot Net Framework.]
Ans: Rowwise please write the code for it.
Lisbox1.Items.Add "Prashant"
Lisbox1.Items.Add "Chinchu"
Lisbox1.Items.Add "Pallavi"
Lisbox1.Items.Add "Suresh"
Lisbox1.Items.Add "Polika".
Ans: Class Class1
‘Define a local variable to store the property value.
Example:
Private PropertyValue As String
Define the property.
Public Property Prop1() As String
Get
‘The Get property procedure is called when the value' of a property is retrieved.
‘Return PropertyValue
End Get
Set(ByVal Value As String)
‘The Set property procedure is called when the value of a property is modified.
‘The value to be assigned is passed in the
‘argument to Set.
PropertyValue = Value
End Set
End Property
End Class.
You liked the article?
Like: 0
Vote for difficulty
Current difficulty (Avg): Medium
TekSlate is the best online training provider in delivering world-class IT skills to individuals and corporates from all parts of the globe. We are proven experts in accumulating every need of an IT skills upgrade aspirant and have delivered excellent services. We aim to bring you all the essentials to learn and master new technologies in the market with our articles, blogs, and videos. Build your career success with us, enhancing most in-demand skills in the market.